package com.woniuxy.controller;

import com.woniuxy.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * @Author: ideaAdmin
 * TODO:
 * Date: 2022/2/14:11:03
 * Description:
 */
@Controller
@RequestMapping("/test")
public class TestController {
//    @ResponseBody
    @RequestMapping("/start")
    public String startTest() {
        return "success";
    }

    @ResponseBody
    @RequestMapping("/date")
    public Date date(Student student){
        System.out.println(student);
        return student.getDate();
    }

    @ResponseBody
    @RequestMapping("/date01")
    public String date01(Student student){
        System.out.println(student);
        return "null";
    }


    @ResponseBody
    @RequestMapping("/date02")
    public Date date02(@RequestBody Student student){
        System.out.println(student);
        return student.getDate();
    }
}

